﻿$(document).ready(function(){//MultiRowGrid
	//MultiRowGrid();
	//JsonGridTest();
	//ExpandGridTest();
	
	
	
		
		var s=new Chenxin.UI.LastYearCombo({
			containerId:'#multirowgrid',
			name:'aaa'
		}); 
		/* 
		var s=new Chenxin.UI.ParameterCombo({
			containerId:'#abc',
			name:'BuildingType',
			key:'Building.Type',
			
			autoLoad:true,
			tbxWidth:60,
			required:true
		});
		
		$('#xx1').click(function(){
			s.setDisable();
		});
		
		
		$('#xx2').click(function(){
			s.setEnable();
		});*/
		
});

function MultiRowGrid(){
	var m=new Chenxin.UI.MultiRowGrid({
		actionUrl: '/service/logic/test1.ashx?op=getjsongrid',
		id: 'esmtable',
		title:'交易设定管理',
		renderTo: 'multirowgrid',
		paegSize:5,
		columns: {
			y:{
				width:120,
				items:{
					UserCode: {
						head: '工号',
						width: 120,
						sortable:true
					},
					UserName: {
						head: '姓名',
						width: 120,
						sortable:true
					},
					Company: {
						head: '公司',
						width: 120,
						sortable:true
					}
				}
			},
			DepartName: {
				head: '部门',
				width: 80,
				sortable:true
			},
			IsBelong: {
				width: 50, 
				head: '隶属'
			},
			IsControl: {
				width: 50, 
				head: '管辖'
			},
			x:{
				width:80,
				head:'报备',
				items:{
					SearchContractArchive: {
						width: 80, 
						head: '查询报备',
						style:'background-color:#ffff00'
					},
					EditContractArchive: {
						width: 80, 
						head: '编辑报备',
						style:'background-color:#ff0000'
					},
					CancelContractArchive: {
						width: 80, 
						head: '作废报备',
						style:'background-color:#ff00ff'
					}
				}
			},
			SearchContractApply: {
				width: 90, 
				head: '查询业绩申请'
			},
			EditContractApply: {
				width: 90, 
				head: '修改业绩申请'
			}
		},
		scope: this
	});
}

function JsonGridTest(){
	var j=new Chenxin.UI.JsonGrid({
		actionUrl: '/service/logic/test1.ashx?op=getjsongrid',
		id: 'esmtable',
		title:'JsonGrid数据',
		paegSize:5,
		renderTo: 'jsongrid',
		modelId:'RecordId',
		columns: {
			y:{
				width:360,
				head:'员工信息',
				items:{
					aa:{
						head:'aaa',
						width:120,
						items:{
							UserCode: {
								head: '工号',
								width: 120,
								sortable:true
							}
						}
					},
					bb:{
						head:'bbb',
						width:240,
						items:{
							UserName: {
								head: '姓名',
								width: 120,
								sortable:true
							},
							Company: {
								head: '公司',
								width: 120,
								sortable:true
							}	
						}
					}
					 /*UserCode: {
						head: '工号',
						width: 120,
						sortable:true
					},
					UserName: {
						head: '姓名',
						width: 120,
						sortable:true
					},
					Company: {
						head: '公司',
						width: 120,
						sortable:true
					}*/	 				
				}
			},
			DepartName: {
				head: '部门',
				width: 80,
				sortable:true
			},
			IsBelong: {
				width: 50, 
				head: '隶属'
			},
			IsControl: {
				width: 50, 
				head: '管辖'
			},
			x:{
				width:240,
				head:'报备',
				items:{
					xxx:{
								width:80,
								head:'xxxx',
								items:{
									SearchContractArchive: {
										width: 80, 
										head: '查询报备'
									}
								}
							},
							yyy:{
								width:160,
								head:'yyyy',
								items:{
									EditContractArchive: {
										width: 80, 
										head: '编辑报备'
									},
									CancelContractArchive: {
										width: 80, 
										head: '作废报备'
									}	
								}
							}
					 /*SearchContractArchive: {
						width: 80, 
						head: '查询报备'
					},
					EditContractArchive: {
						width: 80, 
						head: '编辑报备'
					},
					CancelContractArchive: {
						width: 80, 
						head: '作废报备'
					} */
				}
			},
			SearchContractApply: {
				width: 90, 
				head: '查询业绩申请'
			},
			EditContractApply: {
				width: 90, 
				head: '修改业绩申请'
			}
		},
		scope: this
	});
};
function ExpandGridTest(){	
	var g=new Chenxin.UI.ExpandGrid({
		actionUrl: '/service/logic/test1.ashx?op=getlist',
		id: 'esmtable',
		pageSize:5,
		title:'Grid数据',
		renderTo: 'grid',
		columns: {
			UserCode: {
				head: '工号',
				width: 120,
				sortable:true
			},
			UserName: {
				head: '姓名',
				width: 120,
				sortable:true
			},
			Company: {
				head: '公司',
				width: 120,
				sortable:true
			},
			DepartName: {
				head: '部门',
				width: 80,
				sortable:true
			},
			IsBelong: {
				width: 50, 
				head: '隶属'
			},
			IsControl: {
				width: 50, 
				head: '管辖'
			},
			SearchContractArchive: {
				width: 80, 
				head: '查询报备',
				style:'background-color:#ffff00'
			},
			EditContractArchive: {
				width: 80, 
				head: '编辑报备',
				style:'background-color:#ff0000'
			},
			CancelContractArchive: {
				width: 80, 
				head: '作废报备',
				style:'background-color:#ff00ff'
			},
			SearchContractApply: {
				width: 90, 
				head: '查询业绩申请'
			},
			EditContractApply: {
				width: 90, 
				head: '修改业绩申请'
			}
		},
		scope: this
	});
}